﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="details.aspx.vb" Inherits="HauntedNetworkingSite.details" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="Banner.ascx" TagName="Banner" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Haunted Networking - Details page</title>
    <link href="StyleSheet2.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 810px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc1:Banner ID="Banner1" runat="server" />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <br />
        <table class="style1">
            <tr>
                <td class="detailsclass" valign="top" width="50%">
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1"
                        Height="50px" Width="100%" AllowPaging="True" GridLines="None" HeaderStyle-CssClass="titleclass" HorizontalAlign="Left">
                        <Fields>
                            <asp:ImageField DataImageUrlField="Picture" HeaderText="Picture" 
                                ShowHeader="False">
                                <ItemStyle HorizontalAlign="Left" Width="80%" />
                            </asp:ImageField>
                            <asp:BoundField DataField="Area" HeaderText="Area" SortExpression="Area" 
                                ShowHeader="False" />
                            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" 
                                ShowHeader="False" />
                            <asp:BoundField DataField="Country" HeaderText="Country" 
                                SortExpression="Country" ShowHeader="False">
                            </asp:BoundField>
                            <asp:BoundField DataField="UserName" HeaderText="Added By" 
                                SortExpression="UserName" />
                            <asp:BoundField DataField="Views" HeaderText="Views" SortExpression="Views" />
                            <asp:HyperLinkField DataNavigateUrlFields="ViewOnGoogleMaps" DataTextField="ViewOnGoogleMaps"
                                DataTextFormatString="View On Map" HeaderText="View On Google Maps" 
                                ShowHeader="False" />
                            <asp:BoundField DataField="Description" HeaderText="Description" 
                                SortExpression="Description" ShowHeader="False" />
                        </Fields>
                        <HeaderStyle CssClass="titleclass" />
                    </asp:DetailsView>
                </td>
                <td valign="top">
                <asp:Label ID="label_AverageRating" runat="server" CssClass="labelClass" 
                        Text="Average rating for this location"></asp:Label>
                    <br />
                    <asp:Rating BorderWidth="1" BorderStyle="Solid" Width="200px" Height="46px" ID="Rating2"
                        CurrentRating="0" runat="server" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar"
                        EmptyStarCssClass="emptyRatingStar" FilledStarCssClass="filledRatingStar" MaxRating="5" ReadOnly="true">
                    </asp:Rating><br />
                    <br />
                    <br />
                    <asp:Label ID="label_rate" runat="server" CssClass="labelClass" 
                        Text="Your rating for this place"></asp:Label>
                    <asp:Rating BorderWidth="1" BorderStyle="Solid" Width="200px" Height="46px" ID="Rating1"
                        CurrentRating="0" runat="server" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar"
                        EmptyStarCssClass="emptyRatingStar" FilledStarCssClass="filledRatingStar" MaxRating="5">
                    </asp:Rating>
                    <asp:Button ID="btn_Rate" runat="server" CssClass="buttonClass" Text="Rate" />
                    <br />
                    <br />
                    <br />
                    Tags:<br />
                    <asp:CheckBoxList ID="CheckBoxList_TagList" runat="server" 
                        DataSourceID="TagsOnDetailsPageDataSource" DataTextField="TagName" 
                        DataValueField="ID" RepeatColumns="10" RepeatDirection="Horizontal">
                    </asp:CheckBoxList>
                    <asp:Image ID="Image1" runat="server" ImageAlign="Left" 
                        ImageUrl="~/Images/tag_green.png" />
                    <asp:Button ID="btn_Tag" runat="server" CssClass="buttonClass" Text="Tag!" />
                    <br />
                    <br />
                    <br />
                    Insert a new tag here:
                    <asp:TextBox ID="tb_AddTag" runat="server" AutoCompleteType="Search"></asp:TextBox>
                    <asp:AutoCompleteExtender ID="AutoCompleteExtender1" TargetControlID="tb_AddTag" runat="server" ServicePath="~/tagger.asmx" ServiceMethod = "getTagsFromPrefix" MinimumPrefixLength = "1">
                    </asp:AutoCompleteExtender>
                    <br />
                    <br />
                    <asp:Button ID="btn_AddTag" runat="server" CssClass="buttonClass" 
                        Text="Add Tag" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                <br />
                    
                    <br />
                </td>
                <td>
                    &nbsp;<asp:Label ID="Label1" runat="server" CssClass="titleclass" 
                        Font-Size="1.5em" Text="Tags" Width="80%"></asp:Label>
                    <br />
&nbsp;<asp:PlaceHolder ID="placeHolder_TagCloud" runat="server"></asp:PlaceHolder>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Comments:<br />
                    <br />
                    &nbsp;<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource2">
                        <ItemTemplate>
                            <span style="">Author:
                                <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                                <br />
                                DatePosted:
                                <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>' />
                                <br />
                                Comment:
                                <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                                <br />
                                <br />
                            </span>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <span style="">Author:
                                <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                                <br />
                                DatePosted:
                                <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>' />
                                <br />
                                Comment:
                                <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                                <br />
                                <br />
                            </span>
                        </AlternatingItemTemplate>
                        <EmptyDataTemplate>
                            <span>No comments yet.</span>
                        </EmptyDataTemplate>
                        <InsertItemTemplate>
                            <span style="">Author:
                                <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
                                <br />
                                DatePosted:
                                <asp:TextBox ID="DatePostedTextBox" runat="server" Text='<%# Bind("DatePosted") %>' />
                                <br />
                                Title:
                                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                                <br />
                                Comment:
                                <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
                                <br />
                                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                                <br />
                                <br />
                            </span>
                        </InsertItemTemplate>
                        <LayoutTemplate>
                            <div id="itemPlaceholderContainer" runat="server" style="">
                                <span id="itemPlaceholder" runat="server" />
                            </div>
                            <div style="">
                            </div>
                        </LayoutTemplate>
                        <EditItemTemplate>
                            <span style="">Author:
                                <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
                                <br />
                                DatePosted:
                                <asp:TextBox ID="DatePostedTextBox" runat="server" Text='<%# Bind("DatePosted") %>' />
                                <br />
                                Title:
                                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                                <br />
                                Comment:
                                <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
                                <br />
                                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                <br />
                                <br />
                            </span>
                        </EditItemTemplate>
                        <SelectedItemTemplate>
                            <span style="">Author:
                                <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
                                <br />
                                DatePosted:
                                <asp:Label ID="DatePostedLabel" runat="server" Text='<%# Eval("DatePosted") %>' />
                                <br />
                                Title:
                                <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
                                <br />
                                Comment:
                                <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                                <br />
                                <br />
                            </span>
                        </SelectedItemTemplate>
                    </asp:ListView>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style2" valign="bottom">
                    Add your comment here
                    <asp:LoginName ID="LoginName1" runat="server" />
                    !!!!!<br />
                    <br />
                    &nbsp;<br />
                    <asp:TextBox ID="tb_comment" runat="server" Height="300px" TextMode="MultiLine" Width="491px"></asp:TextBox>
                    <br />
                    <br />
                    <br />
                    <br />
                    <asp:Button ID="btn_submit" runat="server" Text="Submit" 
                        CssClass="buttonClass" /><br />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="style2" valign="bottom">
                    <asp:SqlDataSource ID="TagsOnDetailsPageDataSource" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
                        SelectCommand="SELECT [ID], [TagName] FROM [Tags]"></asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>"
            ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" SelectCommand="SELECT [Picture], [Area], [City], [Country], [ViewOnGoogleMaps], [Description], [UserName], [Views] FROM [locations] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:PlacesConnectionString %>"
            
            ProviderName="<%$ ConnectionStrings:PlacesConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Author], [DatePosted], [Comment] FROM [posting] WHERE ([Location_fkID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="Location_fkID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:LinkButton ID="linkButton_Back" runat="server" CssClass="linkButtonTextSize"
            PostBackUrl="~/list.aspx">Back</asp:LinkButton>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        <Services>
        <asp:ServiceReference Path="~/tagger.asmx" />
        </Services>
        </asp:ToolkitScriptManager>
    </div>
    </form>
</body>
</html>
